//
// Created by shen on 2024/7/3.
//

#include "TSQueue.h"

int TSQueue::getAvpacket(AVPacket *packet) {


}

int TSQueue::putAvpacket(AVPacket *packet) {


}

TSQueue::~TSQueue(){
    clearAvpacket();
}
TSQueue::TSQueue(TSPlayerStatus *playerStatus) {

    this->playstatus=playerStatus;
    //初始化锁
    pthread_mutex_init(&mutePacket,NULL);
    pthread_cond_init(&condPacket,NULL);

}

void TSQueue::clearAvpacket() {
    //通知
    pthread_cond_signal(&condPacket);
    pthread_mutex_unlock(&mutePacket);

    while(!queuePacket.empty()){
        AVPacket  *packet=queuePacket.front();
        queuePacket.pop();
        av_packet_free(&packet);




    }
}

void TSQueue::lock() {


}

void TSQueue::unlock() {



}

int TSQueue::getQueueSize() {


}